// 这个api文件是管理项目的所有接口
import axios from "./request"

// 请求首页数据
export const GetHomeData = () => axios.get("/index/index")

// 请求历史记录和热门搜索(get请求无参数的写法)
export const GetHishotData = () => axios.get("/search/index")

// 请求搜索提示列表(get请求携带参数的写法)
export const GetSearchTipsData = (params) => axios.get("/search/helper", { params }
    // export const GetSearchTipsData = (val) => axios.get("/search/helper", {
    //     params:{
    //         keyword:val
    //     }
    // }

)

// 请求搜索产品列表信息
export const GetGoodsListData = (params) => axios.get("/goods/list", { params })

//请求清除历史记录
export const ClearHistory = () => axios.post("/search/clearhistory")

//发请用户登录请求
export const ToLogin = (params) => axios.post("/auth/loginByWeb",params)

//请求详情页数据  
export const GetGoodsDetail = (params) => axios.get("/goods/detail", { params })

// 请求相关产品  /goods/related
export const GetGoodsRelated = (params) => axios.get("/goods/related",{params});


// 发起购物车请求  /cart/goodscount
export const GetCartNum = () => axios.get("/cart/goodscount");


// 加入购物车请求  /cart/add
export const ToAddCart = (params) => axios.post("/cart/add",params);

//购物车列表数据请求  
export const GetCartDate = () => axios.get("/cart/index");

//购物车点击每一项商品发起请求 /cart/checked
export const chanGoodsChecked = (params) => axios.post("/cart/checked",params);

//商品步进器发送请求 
export const stepNum = (params) => axios.post("/cart/update",params);

//购物车删除按钮
export const DelGoos = (params) => axios.post("/cart/delete",params);
